/*
 * =====================================================================================
 *
 *       Filename:  main.c
 *
 *    Description:  test to call c
 *
 *        Version:  1.0
 *        Created:  2015年08月13日 23时29分19秒
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  yangkun (yk)
 *          Email:  kun.yang@omnificweb.com
 *        Company:  omnificweb.com
 *
 * =====================================================================================
 */
#define NULL 0
//延时很关键，如果找不到正确的延时，很可能就看不到闪灯，跑马灯等效果
void delay()
{
    unsigned int i, j;
    i = 10000, j = 100000;
    for(; i>0; i--)
    {
        for(; j>0; j--)
            ;
    }
}
int main()
{
    volatile unsigned int *p = NULL;
    volatile unsigned int test;

    //GPBCON
    p = 0x56000010;
    *p = ((1<<(5*2)) | (1<<(6*2)) | (1<<(7*2)) | (1<<(8*2))); 
   
    p = 0x56000014;
    while(1)
    {
        for(test=0; test<15; test++)
        {
           *p = (~test)<<5;//value;
           delay();
           delay();
           delay();
        }
    }

}
